#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> pii;

void solve() {
    map<int,int>mp;
    int x;
    for(int i = 0; i < 4; i++)  {
        cin >> x;
        mp[x]++;
    }
    if(mp.size() == 2) {
        cout << "YES\n";
    }else{
        cout << "NO\n";
    }

}

int main() {
    solve();
    return 0;
}